//
//  JonSnowCore.swift
//  Pods
//
//  Created by eme on 2017/1/12.
//
//

import Foundation


/// 本模块的名称， 本模块的storyboard 名称必须 与模块名称相同 ,已经用于静态资源的加载回用到
let modularName = "JonSnowCore"

/// 登陆模块 基础配置文件
public  class JonSnowCore {

    public static var sharedInstance : JonSnowCore {
        struct Static {
            static let instance : JonSnowCore = JonSnowCore()
        }
        return Static.instance
    }
    /// 登陆模块的storyboard
    public static var storyboard:UIStoryboard{
        get{
            return UIStoryboard(name: modularName, bundle: JonSnowCore.bundle)
        }
    }
    /// 模块中的 引导界面vc
    public static var guideVc:UIViewController{
        get{
            return JonSnowCore.storyboard.instantiateViewController(withIdentifier: "GuideVc")
        }
    }
    /// 模块中的 登陆vc
    public static var loginVc:UIViewController{
        get{
            return JonSnowCore.storyboard.instantiateViewController(withIdentifier: "Login_Vc")
        }
    }
    
    ///供其他模块使用
    public static var bundle:Bundle?{
        get{
            guard let bundleURL = Bundle(for: Login_Vc.self).url(forResource: modularName, withExtension: "bundle") else {
                return nil
            }
            guard let bundle = Bundle(url: bundleURL) else {
                return nil
            }
            return bundle
        }
        
    }
    
    init() {
//        guard let path = Bundle.main.path(forResource: "JonSnowCore", ofType: "plist") else {
//            return
//        }
//        guard let dict = NSDictionary(contentsOfFile:path) else {
//            return
//        }
//        
    }
}


